//
//  EditPersonRoleController.m
//  iStage
//
//  Created by michael on 27/07/2008.
//  Copyright 2008 Legal Education Technology Lab. All rights reserved.
//

#import "EditPersonRoleController.h"


@implementation EditPersonRoleController
@synthesize listType;

-(IBAction)doneEditing{
	//should probably be done by KV-coding
	NSLog(@"Value is ");
	NSLog(valueField.text);
	NSLog(valueName);
	if ([DataManager sharedDataManager].currentPerson == nil) {
		[[DataManager sharedDataManager] setCurrentPersonToNewForList:listType];
	}
	[[DataManager sharedDataManager].currentPerson setObject:valueField.text forKey:valueName];
	if ([self parentViewController] == nil) {
		NSLog(@"Parent View Controller is nil");
	}
	else {
		//NSLog([self parentViewController] );
		//		[[self parentViewController] 
		
		
	}
	//	[self dismissModalViewControllerAnimated:YES];	
	[self dismissModalViewControllerAnimated:YES];//[self cancelEditing];
}
-(void)viewDidLoad {
	/* text field data is not appearing text box */
	//noOfPostsTextField.text = [[dm currentBlog] valueForKey:kPostsDownloadCount];
	valueField.text= [[DataManager sharedDataManager].currentPerson valueForKey:self.valueName];
	//	valueField.text = self.value;
	NSLog(@"view did load with value:");
	NSLog(valueField.text);
	[valueField becomeFirstResponder];
}
@end
